fix: keep duplicate pad numbers on one logical pin (#411) - #413
Open
DPS0340 wants to merge 1 commit into
Open
Conversation
Fixes tscircuit#411. When an EasyEDA footprint represents one logical pin with multiple physical pad geometries (e.g. C5656610's four polygon pads all numbered 3 — one GND terminal), convertEasyEdaJsonToCircuitJson passed every geometry independently to normalizePinLabels, which renumbered the later duplicates into synthetic pins (7/8/9). Downstream consumers then bound those shapes as separate unconnected pads. Pin labels are now normalized once per unique pad number, all duplicate geometries share the same logical pin hint, and only one source_port is emitted per logical pin. Snapshot updates: C2838502 / C2913206 / C51950748 (ESP32 modules whose thermal-pad geometries were previously renumbered into synthetic pins — they now correctly share the GND pin).
Author
|
@Abse2001 could you take a look at this one when you have a moment? Small and self-contained. Fixes #411. The official JLCPCB footprint for The fix groups geometries by pad number before normalizing, so duplicates stay on one logical pin. Test covers the real |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #411.
Problem
When an EasyEDA footprint represents one logical pin with multiple physical pad geometries,
convertEasyEdaJsonToCircuitJsontreats every geometry as a separate logical pin: duplicate pad numbers are passed independently tonormalizePinLabels, which renumbers the later geometries into synthetic pins.On
C5656610(ICS-43434, pads numbered1,2,4,5,6,3,3,3,3):Downstream (tscircuit → KiCad) the synthetic pins previously became separate unconnected pads.
Fix
pinNhint.source_portper logical pin instead of one per geometry.Verification
tests/convert-to-soup-tests/duplicate-pad-numbers-411.test.tswith the C5656610 asset from the issue (fails onmainwith synthetic pins 7/8/9)pin54..pin61withpin49_alt1hints; they now correctly share the GND pin, which is visible in the diffs as the synthetic pins disappearingbunx tsc --noEmit/biome check— clean